# local packages
from . import diary_blue


# external packages
from flask import jsonify, request

@diary_blue.route("/getDiaryDetail", methods=['GET'])
def get_diaryDetail():
    if request.method == "GET":
        from .diaryDataController import getSingleDiary
        return getSingleDiary()
    return "进入/diary/getDiaryDetail接口惹"

@diary_blue.route("/getImage", methods=['GET'])
def get_Image():
    if request.method == "GET":
        from .diaryDataController import getSingleImage
        return getSingleImage()
    return "进入/diary/getImage接口惹"

@diary_blue.route("/uploadDiary", methods=['GET', 'POST'])
def get_uploadDiary():
    if request.method == "POST":
        from .diaryDataController import storeDiaryToDatabase

        return storeDiaryToDatabase()
    return "进入/diary/uploadDiary接口惹"

@diary_blue.route("/uploadImage", methods=['GET', 'POST'])
def get_uploadImage():
    if request.method == "POST":
        from .diaryDataController import storeImageToDatabase
        return storeImageToDatabase()
    return "进入/diary/uploadImage接口惹"

@diary_blue.route("/getDiary", methods=['GET'])
def get_diary():
    if request.method == "GET":
        from .diaryDataController import selectDiaryByDate
        return selectDiaryByDate()
    return "进入/diary/getDiary接口惹"

@diary_blue.route("/delDiary", methods=['POST'])
def del_Diary():
    if request.method == "POST":
        from .diaryDataController import delDiary
        return delDiary()
    return "进入/diary/delDiary接口惹"


